package com.gxar.file.server.base.model;

import com.gxar.common.entity.ResultCode;

/**
 * ResultCodeEnum
 *
 * @author Linsy
 * @version 1.0
 * @created 2023/6/20 11:25 AM
 */
public enum ResultCodeEnum implements ResultCode {

    /**
     * 产品未开通
     */
    TEMPORARILY_UNAVAILABLE(20001, "该产品尚未开通，敬请期待"),
    /**
     * 上传失败
     */
    UPLOAD_FAIL(20002, "上传失败，请检查文件正确性"),
    /**
     * 上传异常
     */
    UPLOAD_EXCEPTION(20003, "上传异常，请稍后重试"),
    /**
     * 文件不存在
     */
    FILE_NOT_EXISTS(20004, "文件不存在"),
    /**
     * 下载文件异常
     */
    DOWNLOAD_EXCEPTION(20005, "下载文件异常"),
    KEY_NOT_NULL(20006, "key 不能为空"),

    UNKNOWN_OSS_CLIENT(20007, "未知的oss客户端"),

    CHUNK_INIT_FAIL(20008, "分片初始化失败"),

    UPLOAD_TAG_FAIL(20009, "分片上传失败"),

    CHUNK_COMPLETE_FAIL(20010, "分片合成失败"),
    UPLOAD_FILE_NAME_ERROR(20011, "上传文件名错误"),

    URL_NAME_NOT_NULL(20012, "文件地址和名称不能同时为空"),

    USER_ID_NOT_NULL(20013, "用户ID不能为空"),

    PRODUCT_NOT_NULL(20014, "产品不能为空"),

    CODE_NOT_NULL(20015, "Code不能为空"),

    URL_NOT_NULL(20016, "文件地址不能同时为空"),
    ;

    private final Integer code;
    private final String msg;

    ResultCodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getRet() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
